<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>三栏布局</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .org {
            background-color: #f60;
        }

        .green {
            background-color: #6f0;
        }

        .red {
            background-color: #f06;
        }

        h1 {
            text-align: center;
            line-height: 100px;
        }
    </style>
</head>

<body>
    <h1 style="height: 100px;">各种方式实现三栏布局</h1>
    <section class="float">
        <style>
            .float::after {
                content: '';
                display: block;
                clear: both;
            }

            .float>div {
                height: 100px;
            }

            .float .left {
                width: 300px;
                float: left;
            }

            .float .center {
                float: left;
                width: calc(100% - 600px);
            }

            .float .right {
                width: 300px;
                float: right;
            }
        </style>
        <div class="left org"></div>
        <div class="center green">
            <h1>浮动实现</h1>
        </div>
        <div class="right red"></div>
    </section>

    <section class="position">
        <style>
            .position>div {
                height: 100px;
                position: absolute;
                margin-top: 50px;
            }

            .position .left {
                left: 0;
                width: 300px;
            }

            .position .center {
                left: 300px;
                right: 300px;
            }

            .position .right {
                right: 0;
                width: 300px;
            }
        </style>
        <div class="left org"></div>
        <div class="center green">
            <h1>定位实现</h1>
        </div>
        <div class="right red"></div>
    </section>

    <section class="flex">
        <style>
            .flex {
                display: flex;
                margin-top: 200px;
            }

            .flex>div {
                height: 100px;

            }

            .flex .left {
                width: 300px;
            }

            .flex .center {
                flex: 1;
            }

            .flex .right {
                width: 300px;
            }
        </style>
        <div class="left org"></div>
        <div class="center green">
            <h1>flex实现</h1>
        </div>
        <div class="right red"></div>
    </section>

    <section class="gird">
        <style>
            .gird {
                display: grid;
                margin-top: 50px;
                grid-template-columns: 300px 1fr 300px;
                grid-template-rows: 100px;
            }
        </style>
        <div class="left org"></div>
        <div class="center green">
            <h1>gird实现</h1>
        </div>
        <div class="right red"></div>
    </section>

    <section class="table">
        <style>
            .table {
                display: table;
                margin-top: 50px;
                width: 100%;
            }

            .table>div {
                display: table-cell;
                height: 100px;
            }
            .left,.center,.right{
                display: table-cell;
            }
            .table>.left{
                width: 300px;
            }
            .table>.right{
                width: 300px;
            }
        </style>
        <div class="left org"></div>
        <div class="center green"><h1>table实现</h1></div>
        <div class="right red"></div>

        </div>

    </section class="table">


</body>

</html>